﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CourseUtils;

namespace MaxOfThreeValues
{
    class Program
    {
        static int MaxOfThreeValues(string[] arg)
        {
            int temp;
            int max = Convert.ToInt32(arg[0]);
            for (int count = 1; count <= 3; count++)
            {
                int ValueType = Convert.ToInt32(arg[count-1]);
                if (max <= (temp = Convert.ToInt32(arg[count - 1])))
                    max = temp;                       
            } 
            return max;
        }
        static String ReadStringFromConsole(string displayText)
        {
            Console.WriteLine(displayText);
            String s = Console.ReadLine();
            return s;
        }

        static void Main(string[] args)
        {
            int CountOfCandidatNumbers = 3;
            string[] values = new string[CountOfCandidatNumbers];
            for (int count = 1; count <= CountOfCandidatNumbers; count++)
            {
                values[count-1] = ReadStringFromConsole("Введите число");                
            }
            int max = MaxOfThreeValues(values);

            string numVal = Convert.ToString(max);
            IOHelpers.PrintString2Console(numVal, "Maximum = ");

            Console.ReadKey();
        }
    }
}
